package org_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 组织-部门状态
type orgDepartmentStatus int

var OrgDepartmentStatus orgDepartmentStatus

// 正常
func (c *orgDepartmentStatus) Normal() int {
	return 1
}

// 被删除
func (c *orgDepartmentStatus) Delete() int {
	return 2
}

func (c *orgDepartmentStatus) ToText(value int) string {
	switch value {

	case 1:
		return "正常"

	case 2:
		return "被删除"

	}
	return ""
}

func (c *orgDepartmentStatus) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *orgDepartmentStatus) ToValue(text string) int {
	switch text {

	case "正常":
		return 1

	case "被删除":
		return 2

	}
	return 0
}
